package com.vdm.service.impl;

import com.vdm.dao.VehicleInfoMapper;
import com.vdm.model.VehicleInfo;
import com.vdm.service.VehicleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VehicleServiceImpl implements VehicleService {

    @Autowired
    VehicleInfoMapper vehicleInfoMapper;

    @Override
    public List<VehicleInfo> vehicleInfoList() {
        return vehicleInfoMapper.vehicleInfoList();
    }

    @Override
    public int getVehicleInfoCount() {
        return vehicleInfoMapper.getVehicleInfoCount();
    }

    @Override
    public int updateVehicleInfoStatus(List<Integer> ids, Integer type) {
        if (ids != null && ids.size() > 0) {
            return vehicleInfoMapper.updateVehicleInfoStatus(ids, type);
        } else {
            return 0;
        }
    }

    @Override
    public int updateByPk(VehicleInfo vehicleInfo) {
        return vehicleInfoMapper.updateByPrimaryKeySelective(vehicleInfo);
    }

    @Override
    public int insertSelective(VehicleInfo vehicleInfo) {
        return vehicleInfoMapper.insertSelective(vehicleInfo);
    }

    @Override
    public List<VehicleInfo> getAllVehicleInfo() {
        return vehicleInfoMapper.getAllVehicleInfo();
    }
}
